<%-- 
    Document   : DemoJSP
    Created on : May 11, 2014, 10:14:42 PM
    Author     : bienphongvnn
--%>


<%@page import="javax.swing.JFrame"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script>
            function XuLy(){
            alert("Thong bao");
                <%
                    JFrame frm = new frmGheNgoi();
                    frm.setVisible(true);
                %>
        }
        </script>
        
    </head>
     <%
                    String color = request.getParameter("color");
                    boolean hasPlicitColor;
                    if(color != null){
                        hasPlicitColor = true;
                    }
                    else{
                        hasPlicitColor = false;
                        color = "Red";
                    }
                %>
    <body color = "<%= color%>">
        <form>
            <input type="button" value="Click" onclick="XuLy()">
        </form>
        <%! private int accessCount = 0;%>
        <h1>
            So lan dang nhap vao trang
            <%= ++accessCount%>
        </h1>
        <h1 align = "center">Color Testing</h1>
        <% 
            if(hasPlicitColor){
                out.println("Ban da cung cap mau nen cho chu" + color + ".");
            }
            else{
                out.println("Nguoc lai thi su dung mau mac dinh");
            }
        %>
        <h1>Hello World!</h1>
        <h2>JSP Expression</h2>
        <ul>
            <li>
                Current time: <%= new java.util.Date()%>
            </li>
            <li>
                Your hostname: <%= request.getRemoteHost()%>
            </li>
            <li>
                Your session ID: <%= session.getId()%>
            </li>
            <li>
                The <code>testParam</code> form parameter: <%= request.getParameter("testParam")%>
            </li>
        </ul>
    </body>
</html>
